package com.woniu.platform.contorller;

import com.woniu.aop.OperationLogAnnotation;
import com.woniu.finance.entity.Tender;
import com.woniu.finance.entity.vo.TenderVO;
import com.woniu.platform.entity.PlatformTenderAuditRecord;
import com.woniu.platform.service.PlatformTenderService;
import com.woniu.util.utils.HttpResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Iterator;
import java.util.List;

@RestController
@RequestMapping("PlatformTender")
public class PlatformTenderController {

    @Autowired
    private PlatformTenderService platformTenderService;

    /**
     * 通过多种属性查找标的
     * @return
     */
    @PostMapping("selectTender")
    @OperationLogAnnotation(operModul = "平台-查询标的",operType = "查询",operDesc = "根据属性查询标的")//操作日志注解
    public HttpResult<?> selectTender(TenderVO tenderVO) {
       return platformTenderService.selectTender(tenderVO);
    }

    /**
     * 查找发标待审核标的
     * @return
     */
    @PostMapping("selectTenderStart")
    @OperationLogAnnotation(operModul = "平台-查询待审核标的",operType = "查询",operDesc = "根据属性查询待审核标的")//操作日志注解
    public HttpResult<?> selectTenderStart(TenderVO tenderVO) {
        return platformTenderService.selectTenderStart(tenderVO);
    }

    /**
     * 查找满标待审核标的
     * @return
     */
    @PostMapping("selectTenderFull")
    @OperationLogAnnotation(operModul = "平台-查询满标待审核标的",operType = "查询",operDesc = "根据属性查询满标待审核标的")//操作日志注解
    public HttpResult<?> selectTenderFull(TenderVO tenderVO) {
        return platformTenderService.selectTenderFull(tenderVO);
    }

    /**
     * 标第审核（招标审核，满标审核）
     * @param result
     * @return
     */
    @PostMapping("TenderAudit")
    @OperationLogAnnotation(operModul = "平台-标的审核",operType = "修改、新增",operDesc = "修改标的状态码，生成审核记录")//操作日志注解
    public HttpResult<?> TenderAudit(Integer result,Integer tenderId) {
        return platformTenderService.TenderAudit(result,tenderId);
    }
}
